Skip to content

Add fast minimal build scripts for faster development iteration#15

Open
JanProvaznik wants to merge 17 commits intomainfrom
dev/janprovaznik/fast-minimal-build
Open

Add fast minimal build scripts for faster development iteration#15
JanProvaznik wants to merge 17 commits intomainfrom
dev/janprovaznik/fast-minimal-build

Conversation

@JanProvaznik
Copy link
Owner

Summary

Add build-minimal.cmd/build-minimal.sh scripts that build only the core MSBuild runtime without tests, samples, or package projects. This enables significantly faster build times during development.

Benchmark Results

Scenario Time
Full build (cold) 2:04
Full build (incremental) 0:24
Minimal build with bootstrap (cold) 1:16
Minimal build with bootstrap (incremental) 0:16
Minimal build without bootstrap (incremental) 0:12
Minimal build .NET Core only (incremental) 0:09

Changes

New Scripts: build-minimal.cmd / build-minimal.sh

Builds only core runtime assemblies (no tests, samples, or packages):

# Fastest incremental build (~9 seconds)
.\build-minimal.cmd -nobootstrap -netcore

# Fast incremental with all TFMs (~12 seconds)
.\build-minimal.cmd -nobootstrap

# With bootstrap (~16 seconds incremental)
.\build-minimal.cmd

Options:

  • -nobootstrap - Skip bootstrap for fastest iteration
  • -netcore / -core - Build only .NET Core (net10.0)
  • -netfx - Build only .NET Framework (net472)
  • -release - Release configuration

Other Changes

  • MSBuild.Minimal.slnf - Solution filter for faster IDE load times
  • eng/BootStrapMsBuild.targets - Added SkipUnchangedFiles="true" to Copy task for incremental bootstrap
  • benchmark-build.cmd - Objective benchmark script for measuring build times
  • documentation/wiki/Fast-Builds.md - Documentation for fast build workflows

Usage

For day-to-day development:

  1. Run .\build-minimal.cmd once to create the bootstrap environment
  2. Use .\build-minimal.cmd -nobootstrap for fast rebuilds (~9-12 seconds)
  3. Run .\build.cmd -test before submitting PRs

Copilot AI and others added 15 commits January 26, 2026 12:42
I detected changes in the vs18.3 branch which have not been merged yet
to main. I'm a robot and am configured to help you automatically keep
main up to date, so I've opened this PR.

This PR merges commits made on vs18.3 by the following committers:

* @GangWang01
* @github-actions[bot]
* @dotnet-maestro[bot]
* @YuliiaKovalova
* @dotnet-bot
* @nohwnd
* @Copilot

## Instructions for merging from UI

This PR will not be auto-merged. When pull request checks pass, complete
this PR by creating a merge commit, *not* a squash or rebase commit.

<img alt="merge button instructions"
src="https://i.imgur.com/GepcNJV.png" width="300" />

If this repo does not allow creating merge commits from the GitHub UI,
use command line instructions.

## Instructions for merging via command line

Run these commands to merge this pull request from the command line.

``` sh
git fetch
git checkout vs18.3
git pull --ff-only
git checkout main
git pull --ff-only
git merge --no-ff vs18.3

# If there are merge conflicts, resolve them and then run git merge --continue to complete the merge
# Pushing the changes to the PR branch will re-trigger PR validation.
git push https://github.com/dotnet/msbuild HEAD:merge/vs18.3-to-main
```

<details>
<summary>or if you are using SSH</summary>

```
git push git@github.com:dotnet/msbuild HEAD:merge/vs18.3-to-main
```

</details>


After PR checks are complete push the branch
```
git push
```

## Instructions for resolving conflicts

:warning: If there are merge conflicts, you will need to resolve them
manually before merging. You can do this [using GitHub][resolve-github]
or using the [command line][resolve-cli].

[resolve-github]:
https://help.github.com/articles/resolving-a-merge-conflict-on-github/
[resolve-cli]:
https://help.github.com/articles/resolving-a-merge-conflict-using-the-command-line/

## Instructions for updating this pull request

Contributors to this repo have permission update this pull request by
pushing to the branch 'merge/vs18.3-to-main'. This can be done to
resolve conflicts or make other changes to this pull request before it
is merged.
The provided examples assume that the remote is named 'origin'. If you
have a different remote name, please replace 'origin' with the name of
your remote.

```
git fetch
git checkout -b merge/vs18.3-to-main origin/main
git pull https://github.com/dotnet/msbuild merge/vs18.3-to-main
(make changes)
git commit -m "Updated PR with my changes"
git push https://github.com/dotnet/msbuild HEAD:merge/vs18.3-to-main
```

<details>
    <summary>or if you are using SSH</summary>

```
git fetch
git checkout -b merge/vs18.3-to-main origin/main
git pull git@github.com:dotnet/msbuild merge/vs18.3-to-main
(make changes)
git commit -m "Updated PR with my changes"
git push git@github.com:dotnet/msbuild HEAD:merge/vs18.3-to-main
```

</details>

Contact .NET Core Engineering (dotnet/dnceng) if you have questions or
issues.
Also, if this PR was generated incorrectly, help us fix it. See
https://github.com/dotnet/arcade/blob/main/.github/workflows/scripts/inter-branch-merge.ps1.

---------

Co-authored-by: dotnet-maestro[bot] <42748379+dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Gang Wang <v-gaw@microsoft.com>
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: huulinh99 <huulinhnguyen99@gmail.com>
Co-authored-by: YuliiaKovalova <95473390+YuliiaKovalova@users.noreply.github.com>
Co-authored-by: Jakub Jareš <me@jakubjares.com>
Co-authored-by: Viktor Hofer <viktor.hofer@microsoft.com>
Co-authored-by: Jan Provazník <janprovaznik@microsoft.com>
Co-authored-by: dotnet bot <dotnet-bot@dotnetfoundation.org>
Co-authored-by: Nguyen Huu Linh <43189610+huulinhnguyen-dev@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
I detected changes in the vs18.3 branch which have not been merged yet
to main. I'm a robot and am configured to help you automatically keep
main up to date, so I've opened this PR.

This PR merges commits made on vs18.3 by the following committers:

* @dotnet-maestro[bot]
* @GangWang01
* @github-actions[bot]
* @YuliiaKovalova
* @dotnet-bot
* @nohwnd
* @Copilot

## Instructions for merging from UI

This PR will not be auto-merged. When pull request checks pass, complete
this PR by creating a merge commit, *not* a squash or rebase commit.

<img alt="merge button instructions"
src="https://i.imgur.com/GepcNJV.png" width="300" />

If this repo does not allow creating merge commits from the GitHub UI,
use command line instructions.

## Instructions for merging via command line

Run these commands to merge this pull request from the command line.

``` sh
git fetch
git checkout vs18.3
git pull --ff-only
git checkout main
git pull --ff-only
git merge --no-ff vs18.3

# If there are merge conflicts, resolve them and then run git merge --continue to complete the merge
# Pushing the changes to the PR branch will re-trigger PR validation.
git push https://github.com/dotnet/msbuild HEAD:merge/vs18.3-to-main
```

<details>
<summary>or if you are using SSH</summary>

```
git push git@github.com:dotnet/msbuild HEAD:merge/vs18.3-to-main
```

</details>


After PR checks are complete push the branch
```
git push
```

## Instructions for resolving conflicts

:warning: If there are merge conflicts, you will need to resolve them
manually before merging. You can do this [using GitHub][resolve-github]
or using the [command line][resolve-cli].

[resolve-github]:
https://help.github.com/articles/resolving-a-merge-conflict-on-github/
[resolve-cli]:
https://help.github.com/articles/resolving-a-merge-conflict-using-the-command-line/

## Instructions for updating this pull request

Contributors to this repo have permission update this pull request by
pushing to the branch 'merge/vs18.3-to-main'. This can be done to
resolve conflicts or make other changes to this pull request before it
is merged.
The provided examples assume that the remote is named 'origin'. If you
have a different remote name, please replace 'origin' with the name of
your remote.

```
git fetch
git checkout -b merge/vs18.3-to-main origin/main
git pull https://github.com/dotnet/msbuild merge/vs18.3-to-main
(make changes)
git commit -m "Updated PR with my changes"
git push https://github.com/dotnet/msbuild HEAD:merge/vs18.3-to-main
```

<details>
    <summary>or if you are using SSH</summary>

```
git fetch
git checkout -b merge/vs18.3-to-main origin/main
git pull git@github.com:dotnet/msbuild merge/vs18.3-to-main
(make changes)
git commit -m "Updated PR with my changes"
git push git@github.com:dotnet/msbuild HEAD:merge/vs18.3-to-main
```

</details>

Contact .NET Core Engineering (dotnet/dnceng) if you have questions or
issues.
Also, if this PR was generated incorrectly, help us fix it. See
https://github.com/dotnet/arcade/blob/main/.github/workflows/scripts/inter-branch-merge.ps1.

---------

Co-authored-by: dotnet-maestro[bot] <42748379+dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Gang Wang <v-gaw@microsoft.com>
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: huulinh99 <huulinhnguyen99@gmail.com>
Co-authored-by: YuliiaKovalova <95473390+YuliiaKovalova@users.noreply.github.com>
Co-authored-by: Jakub Jareš <me@jakubjares.com>
Co-authored-by: Viktor Hofer <viktor.hofer@microsoft.com>
Co-authored-by: Jan Provazník <janprovaznik@microsoft.com>
Co-authored-by: dotnet bot <dotnet-bot@dotnetfoundation.org>
Co-authored-by: Nguyen Huu Linh <43189610+huulinhnguyen-dev@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…: Build ID 13167444 (dotnet#13117)

This is the pull request automatically created by the OneLocBuild task
in the build process to check-in localized files generated based upon
translation source files (.lcl files) handed-back from the downstream
localization pipeline. If there are issues in translations, visit
https://aka.ms/icxLocBug and log bugs for fixes. The OneLocBuild wiki is
https://aka.ms/onelocbuild and the localization process in general is
documented at https://aka.ms/AllAboutLoc.
dotnet#12978)

Co-authored-by: Naresh Joshi <Naresh.Joshi@microsoft.com>
…sions when older versions are requested. (dotnet#12909)

Fixes #
Change version check from != to < to allow loading newer assembly
versions when older versions are requested.
dotnet#12370

### Context
MSBuildLoadContext was using exact version matching (!=) when loading
assemblies, preventing version roll-forward. This caused tasks to fail
when requesting an older assembly version even though a newer compatible
version was available.

### Changes Made
- Changed version comparison in MSBuildLoadContext.cs from `!=` to `<`
(line 86)
- Added unit test `MSBuildLoadContext_AcceptsNewerAssemblyVersions` in
TaskBuilder_Tests.cs
- Added test task `ValidateAssemblyVersionRollForward` in
AssemblyLoadContextTestTasks.cs

### Testing
- Added unit test that verifies assembly version roll-forward behavior
- Test requests System.Collections.Immutable v1.0.0.0 and verifies newer
version loads successfully
- Test only runs on platforms with FEATURE_ASSEMBLYLOADCONTEXT (.NET
Core/.NET 5+)

### Notes
This change allows MSBuildLoadContext to accept any assembly version >=
requested version, matching standard .NET assembly loading behavior.

Co-authored-by: Jan Provazník <janprovaznik@microsoft.com>
Fixes dotnet#13041

### Context
At this moment we have multiple different patterns of using
`Microsoft.IO` namespace from `Microsoft.IO.Redist`.

### Changes Made
Refactored `Microsoft.IO` namespace usage.

### Testing
unit tests
…: Build ID 13185812 (dotnet#13128)

This is the pull request automatically created by the OneLocBuild task
in the build process to check-in localized files generated based upon
translation source files (.lcl files) handed-back from the downstream
localization pipeline. If there are issues in translations, visit
https://aka.ms/icxLocBug and log bugs for fixes. The OneLocBuild wiki is
https://aka.ms/onelocbuild and the localization process in general is
documented at https://aka.ms/AllAboutLoc.
Fixes dotnet#13082

### Context
removing a commented out code as described in the ticket.
Update VersionPrefix to 18.5.0 + insertion flow

---------

Co-authored-by: Rainer Sigwald <raines@microsoft.com>
[Automated] Update the MicrosoftBuildVersion defaultValue in the
template.json.

Co-authored-by: github-actions <github-actions@github.com>
Fixes dotnet#13114

- Add localization infrastructure to Microsoft.Build.Framework assembly
- Create Resources/Strings.resx with PathMustNotBeNullOrEmpty and PathMustBeRooted strings
- Add FrameworkResources class (in AssemblyResources.cs) to access resources
  Note: Class named FrameworkResources to avoid InternalsVisibleTo conflicts
- Update AbsolutePath.cs to use localized strings
- Add xlf translation files for all supported languages
- Add tests with [UseInvariantCulture] to verify error messages
## Summary
Add build-minimal.cmd/sh scripts that build only the core MSBuild runtime
without tests, samples, or package projects. This enables significantly
faster build times during development.

## Benchmark Results (on dev machine)
| Scenario | Time |
|----------|------|
| Full build (cold) | 2:04 |
| Full build (incremental) | 0:24 |
| Minimal build with bootstrap (cold) | 1:16 |
| Minimal build with bootstrap (incremental) | 0:16 |
| Minimal build without bootstrap (incremental) | 0:12 |
| Minimal build .NET Core only (incremental) | 0:09 |

## Changes
- build-minimal.cmd / build-minimal.sh: New scripts with options:
  - -nobootstrap: Skip bootstrap for fastest iteration
  - -netcore/-core: Build only .NET Core (net10.0)
  - -netfx: Build only .NET Framework (net472)
  - -release: Release configuration
- MSBuild.Minimal.slnf: Solution filter for faster IDE load
- eng/BootStrapMsBuild.targets: Add SkipUnchangedFiles for incremental bootstrap
- benchmark-build.cmd: Objective benchmark script
- documentation/wiki/Fast-Builds.md: Documentation
@JanProvaznik
Copy link
Owner Author

a good direction though it does not work to build per-tfm!

…ions

- Add /p:UsingToolIbcOptimization=false and /p:UsingToolVisualStudioIbcTraining=false
  to fix VSSetup directory not found errors
- Remove -netcore/-netfx options as they don't work with solution filters
  (NuGet restore traverses the entire project graph regardless of filter)
- Update documentation to match available options
- -core: Build only net10.0 (~3-15 seconds)
- -netfx: Build only net472 (~12-40 seconds)
- Uses Visual Studio MSBuild.exe with /p:TargetFramework
- Builds both MSBuild.csproj and MSBuild.Bootstrap.csproj
- Requires prior restore (run build-minimal.cmd once first)

Validated with test markers that changes to XMake.cs are correctly
reflected in both bootstrap executables.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants